<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>

</body>
<script type="module">
	import Promise from "./index.js";
	const p = new Promise(function(resolve,reject){
		resolve(1);
		// reject(2);
	});
	const p2 = p.then(function(value){
		// 成功回调函数onResolved函数
		// console.log("成功回调",value);
		// return 100+value;
		return new Promise(function(resolve,reject){
			resolve(900);
		})
		
		// throw "异常";
		
	},function(reason){
		// 失败回调函数onRejected函数
		// console.log("失败回调",reason);
		// return 1000;
		// return new Promise(function(resolve,reject){
		// 	reject(900);
		// })
		throw "异常2";
	});
	console.log(p2);// fulfilled,900
	
</script>
</html>